package edu.hawaii.halealohacli.command;

import static org.junit.Assert.assertTrue;
import org.junit.Test;
import org.wattdepot.client.WattDepotClient;

/**
 * Tests the MonitorPower class.
 * @author Jason Yeo
 *
 */
public class TestMonitorPower {

  WattDepotClient client = new WattDepotClient("http://server.wattdepot.org:8190/wattdepot/");
  MonitorPower mPower = new MonitorPower("Mokihana-A", client);
  
  /**
   * sanity check for the name being equal to the one being passed.
   */
  @Test
  public void testPower() {
    assertTrue("Name should be equal to Mokihana-A", mPower.getSource().equals("Mokihana-A"));
  }
  
  /**
   * check for power readings to see if valid results are returned.
   */
  @Test
  public void testReading() {
    mPower.run();
    assertTrue("Power is more than 0", mPower.getPower() > 0);
  }

}
